const request = require("../utils/request");
const path = "/api/v1/customer";
//列出顾客的全部订单
const OrderList = (data: any) => request("get", path + "/order/s", data);
//获取最新订单信息
const GetOrderLatest = (data: any) =>
  request("get", path + "/order/latest", data);
//根据 id 获取订单信息
const GetOrderId = (data: any) =>
  request("get", path + "/order/id/" + data.id, data);
//根据 serial 获取订单信息
const GetOrderSerial = (data: any) =>
  request("get", path + "/order/serial/" + data.serial, data);
//创建订单
const PostOrder = (data: any) => request("post", path + "/order/new", data);
//请求取消指定 id 的订单
const CancelOrder = (id: any) =>
  request("post", path + "/order/" + id + "/cancel");
//确认订单
const ConfirmOrder = (id: any) =>
  request("post", path + "/order/" + id + "/confirm");
//完成订单
const FinishOrder = (id: any) =>
  request("post", path + "/order/" + id + "/finish");
export {
  OrderList,
  GetOrderLatest,
  GetOrderId,
  GetOrderSerial,
  PostOrder,
  CancelOrder,
  ConfirmOrder,
  FinishOrder,
};
